import Vue from 'vue'
import Router from 'vue-router'
import category from "@/components/category.vue";
import book from "@/components/book.vue";
import index from "@/components/index.vue"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/book',
      name: 'book',
      component: book
    },
    {
      path: '/category',
      component: category
    }
  ]
})
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
